package com.example.demoface.config;


import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.amazonaws.ClientConfiguration;
import com.amazonaws.Protocol;
import com.amazonaws.auth.PropertiesCredentials;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.S3ClientOptions;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Configuration
public class OosClientConfig {

//    @Value("${oos.config.access-key}")
//    private String accessKey;
//
//    @Value("${oos.config.secret-key}")
//    private String secretKey;
//
//    @Value("${oos.config.endpoint}")
//    private String endpoint;
//
//    @Value("${oos.config.bucket}")
//    private String bucket;

    @Bean
    public OSS oosClient() {
        String endpoint = "";
        String accessKeyId = "";
        String accessKeySecret = "";

        // 创建 OSS 客户端
        OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
        return ossClient;
    }
}

